<template>
	<view>
		<u-popup v-model="showclues1" mode="bottom" height="500rpx" @close="closepop" :mask-close-able="false">
			<view class="popupmainnum">
				<!-- 李小红先生 -->
				<view class="poptop">
					<view class="hisnames">{{ datass.title }}</view>
					<template v-if="datass.num">
						<button @click="callfix(datass.button1)" class="poppt" type="default">固定电话:{{ datass.button1 }}</button>
						<button @click="callmobile(datass.button2)"  class="poppt" type="default">手机电话:{{ datass.button2 }}</button>
						
					</template>

					<template v-if="!datass.num">
						<button class="poppt" type="default">{{ datass.button1 }}</button>
						<button class="poppt" type="default">{{ datass.button2 }}</button>
					</template>
				</view>
				<view class="popbottom">
					<view class="" @click="closepop">{{ datass.button3 }}</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>

<script>
export default {
	props: ['showclues1', 'datass'],
	data() {
		return {};
	},
	onLoad() {
		console.log(this.datass);
	},
	methods: {
		closepop() {
			/* this.showclues1=false; */
			/* console.log("1223"); */
			this.$emit('closepop');
		},
		callfix(num){
			
		   	uni.makePhoneCall({
		   		// 手机号
		   		phoneNumber: num,
		   		// 成功回调
		   		success: (res) => {
		   			console.log('调用成功!',num)
		   		},
		   		// 失败回调
		   		fail: (res) => {
		   			console.log('调用失败!')
		   			this.call_phone();//重复调用一次
		   		}
		   	});
		  
		},
		callmobile(num){
			console.log('callmobile');
			uni.makePhoneCall({
				// 手机号
				phoneNumber: num,
				// 成功回调
				success: (res) => {
					console.log('调用成功!',num)
				},
				// 失败回调
				fail: (res) => {
					console.log('调用失败!')
					this.call_phone();//重复调用一次
				}
			});
		}
	}
};
</script>

<style lang="scss">
.popupmainnum {
	width: 750rpx;
	height: 500rpx;
	background-color: #999999;

	padding: 40rpx;

	.poptop {
		border-radius: 10rpx;
		color: #1678ff;
		background-color: #ffffff;
		text-align: center;
		line-height: 80rpx;
		.hisnames {
			display: block;
			text-align: center;
			height: 150rpx;
			font-size: 30rpx;
			line-height: 150rpx;
			background-color: #f8f8f8;
			color: #999999;
		}
		.poppt {
			color: #1678ff;

			/* border-bottom: 1rpx solid #eeeeee; */
			.clickH {
				background-color: #fff;
				color: #1678ff;
			}
		}
	}
	.popbottom {
		border-radius: 10rpx;
		margin-top: 50rpx;
		text-align: center;
		padding: 10rpx 20rpx 20rpx;
		line-height: 40rpx;
		background-color: #ffffff;
		color: #1678ff;
	}
}
</style>
